package com.taichuan.selfcheck.ui.adapter;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.taichuan.selfcheck.R;

import java.util.List;

/**
 * 开机日志子项适配器
 */
public class PowerLogAdapter extends BaseQuickAdapter<String[], BaseViewHolder> {

    private List<String[]> list;

    public PowerLogAdapter(@Nullable List<String[]> data) {
        super(R.layout.item_power_on_off_log,data);
        list = data;
    }

    @Override
    protected void convert(BaseViewHolder helper, String[] item) {
        helper.setText(R.id.time,item[0]);
        helper.setText(R.id.boot,item[1]);
    }

    public void addData(int position,String[] data) {
//      在list中添加数据，并通知条目加入一条
        list.add(position, data );
    }
}
